# Do deploys for environment "{{ env }}"
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root

{% if force_deploy is defined and force_deploy.crontime is defined %}
#
# Force deploy
#
{{ force_deploy.crontime }} root meza deploy-notify "{{ env }}" "{{ _force_deploy_notify_prefix }}" "{{ _force_deploy_options }}"
{% endif %}


{% if autodeployer is defined and autodeployer.crontime is defined %}
#
# Auto-deploy on config and Meza changes
#
{{ autodeployer.crontime }} root meza autodeploy "{{ env }}" "Deploy" "" >> {{ m_logs }}/deploy/check-for-changes-`date "+\%Y\%m\%d"`.log 2>&1


{% if push_backup is defined and push_backup.crontime is defined %}
#
# Push backup (db and uploads) to another server periodically
#
{{ push_backup.crontime }} root meza push-backup "{{ env }}" >> {{ m_logs }}/deploy/push-backup-`date "+\%Y\%m\%d"`.log 2>&1
{% endif %}
{% endif %}
